package com.my.screenadapter.utils;

import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.LinearLayout;

/**
 * Created by 张英杰 on 2017/3/2.
 */

public class MyViewUtils {
    //增加btn
    public static void addButton(ViewGroup viewGroup, Button btn, String str, View.OnClickListener listener) {
        viewGroup.addView(btn);
        btn.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
        btn.setText(str);
        btn.setOnClickListener(listener);
    }
}
